import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

public class Thread1 {
    public static void main(String[] args) {
        Thread mainThread=Thread.currentThread();
        System.out.println("线程名称："+mainThread.getName());
        Thread thread=new MyThread();
        thread.start();
    }
     static class MyThread extends Thread{
         @Override
         public void run() {
             Thread thread=Thread.currentThread();
             try {
                 Thread.sleep(1000);
             } catch (InterruptedException e) {
                 e.printStackTrace();
             }
             System.out.println("线程名称："+thread.getName());
         }
     }
}
